﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:myBoard_App_Model="clr-namespace:myBoard.App.Model"
	x:Class="myBoard.App.CategorySelector"
	x:Name="UserControl">

	<UserControl.Resources>
		<myBoard_App_Model:Instances x:Key="InstancesDataSource" d:IsDataSource="True"/>
		<DataTemplate x:Key="CategoryDataTemplate">
			<Grid>
				<CheckBox x:Name="_catChk" Content="{Binding Name}" d:LayoutOverrides="Width, Height" HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding IsChecked, Mode=TwoWay}" Checked="_catChk_Checked" Unchecked="_catChk_Unchecked"/>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource InstancesDataSource}}">
		<ListBox x:Name="_categoriesLbx" DataContext="{Binding CategoriesViewModel, Mode=Default}" ItemsSource="{Binding Mode=OneWay}" ItemTemplate="{DynamicResource CategoryDataTemplate}"/>
	</Grid>
</UserControl>